package com.ytjj.qmyx.supplychain.common.model.request;

import lombok.ToString;
import org.springframework.util.StringUtils;

import java.util.Date;
import java.util.List;

/**
 * @Description 平台导出订单请求
 * @ClassName PlatformExportRequest
 * 
 * 
 * @Version 1.0
 **/

@ToString
public class PlatformExportRequest {

    /**
     * 订单号
     */
    private String orderNo;

    /**
     * 是否导出
     */
    private Integer isExport;

    /**
     * 商品名称
     */
    private String productName;

    /**
     * 开始时间
     */
    private Date startTime;

    /**
     * 截止时间
     */
    private Date endTime;

    /**
     * 用户名
     */
    private String userName;

    /**
     * 用户电话
     */
    private String userTel;

    /**
     * 订单发货状态
     */
    private Integer orderStatus;

    /**
     * 订单状态
     */
    private Integer status;

    /**
     * 仓库名称
     */
    private String warehouse;

    /**
     * 仓库
     */
    private String bankerName;
    /**
     * bankerId
     */
    private Integer bankerId;

    private List<String> orderNoList;//无效订单或退款订单

    private List<String> orderstatus;
    private String orderStatusStr;
    //供应商级别 0-xxxx账号  1-供应商账号
    private Integer level;

    public String getOrderNo() {
        return orderNo;
    }

    public void setOrderNo(String orderNo) {
        this.orderNo = orderNo;
    }

    public Integer getIsExport() {
        return isExport;
    }

    public void setIsExport(Integer isExport) {
        this.isExport = isExport;
    }

    public String getProductName() {
        return productName;
    }

    public void setProductName(String productName) {
        this.productName = productName;
    }

    public Date getStartTime() {
        return startTime;
    }

    public void setStartTime(Date startTime) {
        this.startTime = startTime;
    }

    public Date getEndTime() {
        return endTime;
    }

    public void setEndTime(Date endTime) {
        this.endTime = endTime;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getUserTel() {
        return userTel;
    }

    public void setUserTel(String userTel) {
        this.userTel = userTel;
    }

    public Integer getOrderStatus() {
        return orderStatus;
    }

    public void setOrderStatus(Integer orderStatus) {
        this.orderStatus = orderStatus;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public String getWarehouse() {
        return warehouse;
    }

    public void setWarehouse(String warehouse) {
        this.warehouse = warehouse;
    }

    public String getBankerName() {
        return bankerName;
    }

    public void setBankerName(String bankerName) {
        this.bankerName = bankerName;
    }

    public Integer getBankerId() {
        return bankerId;
    }

    public void setBankerId(Integer bankerId) {
        this.bankerId = bankerId;
    }

    public List<String> getOrderNoList() {
        return orderNoList;
    }

    public void setOrderNoList(List<String> orderNoList) {
        this.orderNoList = orderNoList;
    }

    public List<String> getOrderstatus() {
        return orderstatus;
    }

    public void setOrderstatus(List<String> orderstatus) {
        this.orderstatus = orderstatus;
    }

    public String getOrderStatusStr() {
        return orderStatusStr;
    }

    public void setOrderStatusStr(String orderStatusStr) {
        this.orderStatusStr = orderStatusStr;
    }

    public Integer getLevel() {
        return level;
    }

    public void setLevel(Integer level) {
        this.level = level;
    }

    @Override
    public boolean equals(Object obj) {
        if(this == obj){
            return true;//地址相等
        }

        if(obj == null){
            return false;//非空性：对于任意非空引用x，x.equals(null)应该返回false。
        }

        if(obj instanceof PlatformExportRequest){
            PlatformExportRequest other = (PlatformExportRequest) obj;
            //需要比较的字段相等，则这两个对象相等
            if(equalsStr(this.bankerName, other.bankerName)
                    && equalsStr(this.orderStatusStr, other.orderStatusStr)){
                return true;
            }
        }

        return false;
    }

    private boolean equalsStr(String str1, String str2){
        if(StringUtils.isEmpty(str1) && StringUtils.isEmpty(str2)){
            return true;
        }
        if(!StringUtils.isEmpty(str1) && str1.equals(str2)){
            return true;
        }
        return false;
    }
    @Override
    public int hashCode() {
        int result = 17;
        result = 31 * result + (bankerName == null ? 0 : bankerName.hashCode());
        result = 31 * result + (orderStatusStr == null ? 0 : orderStatusStr.hashCode());
        return result;
    }
}
